import mlp.Data;
import mlp.MLP;
import mlp.MlpPso;
import pso.PSO_Global;
import function.SigmoidalFunction;
import ga.GA;


public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {


		//GA ga = new GA(new MlpPso(".\\seedTreino.txt"), 20, 50000);
		//double[] melhorPosicao = ga.run();
		//receives a list with the layers size values. Ex.: [3,5,4,2] => input = 3, 2 hidden layers (5 e 4), and output = 2

		PSO_Global pso;
		MlpPso mlppso;
		double[] melhorPosicao;
		for (int i = 0; i < 10; i++) {
			mlppso = new MlpPso(".\\seedTreino.txt");
			System.out.println("--------------------------------------------");
			System.out.println("Iteracao " + i);
			pso = new PSO_Global(mlppso, 20, 10000, "teste.txt");
			melhorPosicao = pso.run();	
			System.out.println("EMQ Treino = " + mlppso.emq());
			
			
			mlppso = new MlpPso(".\\seedValidacao.txt");
			mlppso.mlp.changeWeigths(melhorPosicao);
			System.out.println("EMQ Validacao = " + mlppso.emq());
			System.out.println("*******************************************");
			System.out.println();
		}




	}

}
